package org.example.service.impl;

import org.example.service.HelloService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class HelloServiceImpl implements HelloService {
    @Override
    @Async
    public void saveLog() {
        System.err.println(Thread.currentThread().getName());
    }

    @Override
    @Async
    public String news() {
        System.out.println("####sendSms####   2");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("####sendSms####   3");
        return Thread.currentThread().getName();
    }
}
